import base from './baseapi'
import wepy from 'wepy';
import Tips from '../utils/Tips';


/**
 * 自提API接口数据
 */
export default class shopcartapi extends base {


    ///根据城市获取自提点列表
    static async GetAdressList(params) {       
        let res = await this.get('vshop', 'SalfFetch/GetAdressList', params);
        return res;
    }
    ///获取自提点支持的城市列表
    static async GetSupportCity(params) {
        //let data={index:"index",rand:`${Math.random()}`};
        let res = await this.get('vshop', 'SalfFetch/GetSupportCity', params);
        return res;
    }
    //获取待自提订单详情
    static async GetSelfFetchDetails(params) {
        let res = await this.get('vshop', 'Order/GetSelfFetchDetails',params );
        return res;
    }

    //确认自提
    static async SetFinishSelfFetchOrder(params) {
        let res = await this.postForm('vshop', 'Order/SetFinishSelfFetchOrder',params );
        return res;
    }

    //待自提列表

    static async GetSelfFetchOrderList(params) {
        let res = await this.get('vshop', 'Order/GetSelfFetchOrderList',params );
        return res;
    }

    //确认订单页面数据
    static async ConfrimShopCartInfo(params) {
        let res = await this.postJson('vshop', 'ShopCart/ConfrimShopCartInfo',params );
        return res;
    }
    //删除
    static async DeleteFromShopCart(params) {
        let res = await this.postJson('vshop', 'ShopCart/DeleteFromShopCart',params );
        return res;
    }

    //再来一单
    static async AddToShopCart(params) {
        let res = await this.postForm('vshop', 'ShopCart/AddToShopCartByOrderNo',params );
        return res;
    }

    //直接下单购买
    static async AddToShopCartByOrderNo(data) {
        let res = await this.postForm('vshop', 'ShopCart/SavePurchaseCart',data );
        return res;
    }



}
